<table class="table table-bordered" id="privilege-lists-table" data-toggle="datagrid" data-options="{
    tableWidth: '100%',
    height: '100%',
    gridTitle : '员工角色列表',
    showToolbar: true,
    toolbarItem: 'add,del',
    local: 'local',
    dataUrl: '/admin/company/privilege-lists',
    paging: {pageSize:50, pageCurrent:5},
    linenumberAll: false,
    showLinenumber: false,
    showCheckboxcol: true,
    filterThead: false,
    showEditbtnscol: '操作',
    editUrl: '/admin/company/privilege-edit',
    editCallback:editCallback,
    delUrl:'/admin/company/privilege-delete',
    delPK: 'id',
    delConfirm: true,
}">
    <thead>
    <tr>
        <th data-options="{name:'id',width:50,align:'center',add:false,edit:false}">编号</th>
        <th data-options="{name:'title',align:'center'}">权限角色名称</th>
        <th data-options="{name:'login_start_time',type:'date',pattern:'HH:mm',align:'center',}">登录开始时间</th>
        <th data-options="{name:'login_end_time',type:'date',pattern:'HH:mm',align:'center',}">登录结束时间</th>
        <th data-options="{align:'center',render:permission_assignment}">编辑权限</th>
    </tr>
    </thead>
</table>
<script type="text/javascript">
    function editCallback( json ){
        BJUI.navtab('reload');
    }
    function permission_assignment(value, data)
    {
        var appset = '<button type="button" class="btn btn-info" data-toggle="navtab" data-options="';
        appset += '{id:\'privilege-work-navtab\',title:\'设置'+data.title+'工作界面按钮\',';
        appset += 'fresh:true,';
        appset += 'url:\'/admin/company/privilege-work\',data:{id:' + data.id + '}}';
        appset += '">工作按钮</button>';
        var appnode = '<button type="button" class="btn btn-info" data-toggle="navtab" data-options="';
        appnode += '{id:\'privilege-node-navtab\',title:\'设置'+data.title+'app操作节点\',';
        appnode += 'fresh:true,';
        appnode += 'url:\'/admin/company/privilege-node\',data:{id:' + data.id + '}}';
        appnode += '">节点设置</button>';
        var contact = '<button type="button" class="btn btn-info" data-toggle="navtab" data-options="';
        contact += '{id:\'privilege-contact-navtab\',title:\'设置'+data.title+'通讯录\',';
        contact += 'fresh:true,';
        contact += 'url:\'/admin/company/privilege-contact\',data:{id:' + data.id + '}}';
        contact += '">通讯录</button>';
        var html = appset+appnode+contact;
        return html;
    }
</script>